//
//  ContactPeople.m
//  timelyRain
//
//  Created by Jiafei Wei on 16/9/21.
//  Copyright © 2016年 Jiafei Wei. All rights reserved.
//

#import "ContactPeople.h"
#import "PeopleCell.h"
#import "TimeMyGroup.h"
@interface ContactPeople ()<UITableViewDelegate,UITableViewDataSource>
{
    NSMutableArray *nameArray;
}
- (IBAction)edit:(id)sender;
@property (weak, nonatomic) IBOutlet UITableView *table;

@end

@implementation ContactPeople

- (void)viewDidLoad {
    [super viewDidLoad];
    nameArray =[NSMutableArray array];
    [super setTitleView:self.view withName:@"联系人"];
    _table.delegate =self;
    _table.dataSource =self;
    [nameArray addObject:@"组名"];
    [nameArray addObject:@"住宅"];
    [nameArray addObject:@"生日"];
    [nameArray addObject:@"纪念"];
    [nameArray addObject:@"工作"];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return nameArray.count;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    PeopleCell *people = [PeopleCell setPeopleCellWithTableView:tableView];
    NSString *name =[nameArray objectAtIndex:indexPath.row];
    people.name.text =name;
    return people;
}
- (IBAction)edit:(id)sender {
    TimeMyGroup *group =[[TimeMyGroup alloc]init];
    [self.navigationController pushViewController:group animated:YES];
}
@end
